package cn.easytogo.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import cn.easytogo.bean.Resource;
import cn.easytogo.bean.User;


public interface IResourceDAO {
	public static int MOVE_DIRECTION_UP=1;
	public static int MOVE_DIRECTION_DOWN=2;
	public static int MOVE_DIRECTION_LEFT=3;
	public static int MOVE_DIRECTION_RIGHT=4;
	/**
	 * 插入一个功能
	 * */
	public Object insertResource(Resource resource) throws SQLException;
	/**
	 * 根据条件查询相应功能
	 * */
	public List selectResources(Map map) throws SQLException;
	/**
	 * 更新一个功能
	 * */
	public int updateResource(Resource resource) throws SQLException;
	/**
	 * 更新多个功能(通过事务进行控制)
	 * */
	public int updateResources(List resources) throws SQLException;
	/**
	 * 删除一个功能
	 * */
	public int deleteResource(Resource resource) throws SQLException;
	/**
	 * 根据ID查询相应功能
	 * */
	public Resource selectResourceById(Map map) throws SQLException;
	/**
	 * 根据排序查询相应功能
	 * */
	public Resource selectResourceByOrderCode(Map map) throws SQLException;
	/**
	 * 根据用户查询其相应的功能
	 * */
	public List<Resource> selectResourcesByUser(User user) throws SQLException;
	/**
	 * 查询所有的功能
	 * */
	public List<Resource> selectAllResources() throws SQLException;
}
